package com.cevent.zhanniu.server.dto;/**
 * Created by Cevent on 2020/11/22.
 */

import java.util.List;

/**
 * @author cevent
 * @description 分页实体类<泛型>
 *     使用泛型的地方都可以用Object代替，泛型可以在编译期间发现问题，避免了代码中写强制类型转换
 * @date 2020/11/22 16:14
 */
public class PageDto<T> {
    //当前页码
    protected int currentPage;
    //每页条数
    protected int initPageNum;
    //总条数
    protected long sumPage;
    //查询结果页的集合，返回结果不确定类型，使用泛
    protected List<T> list;

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getInitPageNum() {
        return initPageNum;
    }

    public void setInitPageNum(int initPageNum) {
        this.initPageNum = initPageNum;
    }

    public long getSumPage() {
        return sumPage;
    }

    public void setSumPage(long sumPage) {
        this.sumPage = sumPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("PageDto{");
        sb.append("currentPage=").append(currentPage);
        sb.append(", initPageNum=").append(initPageNum);
        sb.append(", sumPage=").append(sumPage);
        sb.append(", list=").append(list);
        sb.append('}');
        return sb.toString();
    }
}
